<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>众筹管理后台</title>
		<link rel="stylesheet" href="<%=basePath %>admin/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=basePath %>admin/css/dashboard.css" />
	</head>
	<body>
		
		 <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">众筹管理平台</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
        	
          <ul class="nav navbar-nav navbar-right">
          	<li><a href="<%=basePath %>/pages/index.action">首页</a></li>
          	<li><a href="#">欢迎 ${admin.name }</a></li>
            <li><a href="#" title="修改个人资料和密码的页面">设置</a></li>
            <li><a href="#" title="退出登录">退出</a></li>
          </ul>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
        	<ul class="nav nav-sidebar">
            <li ><a href="<%=basePath %>/pages/index.action">首页</a></li>
           </ul>
          <ul class="nav nav-sidebar">
            <li><a href="<%=basePath %>Projects/mav.action">所有项目*</a></li>
            <li><a href="<%=basePath %>Projects/projecReview.action">项目审核</a></li>
            <li><a href="<%=basePath %>Projects/trackingList.action">项目跟踪</a></li>
            <li class="active"><a href="<%=basePath %>Projects/productComments.action">项目评论</a></li>
           <li><a href="<%=basePath %>Projects/classity.action">项目分类*</a></li>
            <li><a href="<%=basePath %>Projects/recommend.action">项目推荐</a></li>
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="<%=basePath %>pages/backReg.action">注册管理员</a></li>
            <!-- <li><a href="">用户资金</a></li>
            <li><a href="">用户日志</a></li> -->
            <!-- <li><a href="">实名审核</a></li> -->
          </ul>
          <ul class="nav nav-sidebar">
            <li><a href="<%=basePath %>news/list.action">新闻管理</a></li>
            <li><a href="<%=basePath %>Projects/questionall.action">问题管理</a></li>
            <li><a href="<%=basePath %>adminLogin/adminList.action">管理用户</a></li>
           <!--  <li><a href="">管理日志</a></li> -->
          </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h1 class="page-header">XXX项目</h1>
		
			<%-- <ul class="nav nav-tabs">
		  <li role="presentation" ><a href="<%=basePath %>Projects/info.action?ps_id=${temp }">基本信息</a></li>
		  <li role="presentation" ><a href="<%=basePath %>Projects/detail.action?ps_id=${temp }">项目信息</a></li>
		  <li role="presentation" class="active"><a href="<%=basePath %>Projects/comments.action?id=${temp }">项目评论</a></li>
		  <li role="presentation"><a href="product-info4.html">项目进度</a></li>
		  <li role="presentation"><a href="product-info5.html">项目跟踪</a></li>
		</ul> --%>
		<div class="panel panel-default">
  <div class="panel-heading">
    <div class="panel-title">
    	所有项目评论列表
    </div>
  </div>
  <div class="panel-body">
   
          <div class="table-responsive ">
            <table class="table table-striped table-bordered">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>用户姓名</th>
                  <th>项目名字</th>
                  <th>评论内容</th>
                  <th>评论时间</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              <c:forEach items="${findAllSplit}" var="comments">
                <tr>
                  <td>${comments.id }</td>
                  <td>${comments.user.name }</td>
                  <td>${comments.projects.name }</td>
                  <td>${comments.content }</td>
                  <td><fmt:formatDate value="${comments.time }" type="both"/></td>
                  <td>
                 <!--  <a class="fa fa-info" title="详情" href="detail.html"></a> -->
                  	<%-- <a href="<%=basePath %>Projects/info.action?ps_id=${comment.id }">详情</a> --%>
                  	<!-- <a href="#" title="查看项目详情"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></a>
                  	&nbsp;&nbsp;
                  	<a href="#" title="编辑项目信息"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></a>
                  	&nbsp;&nbsp; -->
                  	<a class="glyphicon glyphicon-remove" href="#" onclick="confirmDelete(${comments.id})" title="删除评论信息"></a>
                  </td>
                </tr>
                </c:forEach>
              </tbody>
            </table>
          </div>
				<div class="pager-info">
							<div>共有 ${findAllCount}条记录，第 ${currentPage}/${allPage} 页</div>
							<div>
								<ul class="pagination">
									<c:if test="${currentPage > 1}">
										<li><a
											href="<%=basePath %>Projects/productComments.action?currentPage=${currentPage-1}&lineSize=${lineSize}">上一页</a>
										</li>
									</c:if>
									<c:if test="${currentPage <= 1}">
										<li class="paginate_button previous disabled }"><a
											href="#">上一页</a></li>
									</c:if>

									<c:forEach begin="1" end="${allPage}" step="1" var="pageNum">
										<c:if test="${currentPage eq pageNum }">
											<li class="paginate_button active"><a               
												href="<%=basePath %>Projects/productComments.action?currentPage=${pageNum}">${pageNum}</a></li>
										</c:if>
										<c:if test="${currentPage ne pageNum }">
											<li class="paginate_button"><a
												href="<%=basePath %>Projects/productComments.action?currentPage=${pageNum}">${pageNum}</a></li>
										</c:if>
									</c:forEach>
									<c:if test="${currentPage < allPage}">
										<li><a
											href="<%=basePath %>Projects/productComments.action?currentPage=${currentPage+1}&lineSize=${lineSize}">下一页</a>
										</li>
									</c:if>
									<c:if test="${currentPage >= allPage}">
										<li class="paginate_button previous disabled }"><a
											href="#">下一页</a></li>
									</c:if>
								</ul>
							</div>
						</div>
  </div>
</div>
</div>
</div>
</div>
		<script type="text/javascript" src="<%=basePath %>admin/js/jquery1.12.4.min.js" ></script>
		<script type="text/javascript" src="<%=basePath %>admin/js/bootstrap.min.js" ></script>
		<script type="text/javascript" src="<%=basePath %>admin/js/countUp.js" ></script>
		<script>
			/* $(document).ready(function() {
				
			}); */
			function confirmDelete(id){
				if (confirm("确定要删除码？")) {
					//alert('发送删除请求，刷新页面（不要异步）');
					window.location.href = "<%=basePath %>Projects/commentsRemove.action?cm_id="+id;
				}
				return false;
			}
		</script>
	</body>
</html>
